/*******************************************************************************
* Project: QSAR(Cute Software Architecture) 
*
* Copyright: Copyright(C) 2024 by YuetingBen, All Rights Reserved
*
* File name: DemCfg.c
*
* Brief: ;
*
* Author: Yueting.Ben
*
* Module: Dem
*
*******************************************************************************/

/** HEADER FILES **/
#include "DemCfg.h"


/** MACRO DEFINITION **/


/** TYPEDEF DEFINITION **/


/** LOCAL DATA DECLARATION **/
const Dem_DataElementClassType Dem_DataElementClassConfig[1u];
const Dem_ExtendedDataRecordClassType Dem_ExtendedDataRecordClassConfig[1u];
const Dem_ExtendedDataClassType Dem_ExtendedDataClassConfig[1u];

const Dem_FreezeFrameRecordClassType Dem_FreezeFrameRecordClassConfig[1u];
const Dem_FreezeFrameRecNumClassType Dem_FreezeFrameRecNumClassConfig[1u];

const Dem_DidClassType Dem_DidClassConfig[1u];
const Dem_FreezeFrameClassType Dem_FreezeFrameClassConfig[1u];

const Dem_DTCType Dem_DtcConfig[DemConf_DemEventId_Max];
const Dem_OperationCycleType Dem_OperationCycleConfig[1u];

const Dem_DebounceTimeBasedClassType Dem_DebounceTimeBasedClassConfig[DemConf_DemEventId_Max];
const Dem_DebounceCounterBasedClassType Dem_DebounceCounterBasedClassConfig[DemConf_DemEventId_Max];
const Dem_DebounceAlgorithmClassType Dem_DebounceAlgorithmClassConfig[DemConf_DemEventId_Max];

const Dem_EventParameterType Dem_EventParameterConfig[DemConf_DemEventId_Max]; 


/** LOCAL DATA **/

const Dem_DataElementClassType Dem_DataElementClassConfig[1u] = 
{
    {0x00u}
};

const Dem_ExtendedDataRecordClassType Dem_ExtendedDataRecordClassConfig[1u] = 
{
    /* dataElementClassRef,                                        recordNumber, recordTrigger,            recordUpdate */
    {(Dem_DataElementClassType*)&Dem_DataElementClassConfig[0],  1u,           DEM_TRIGGER_ON_CONFIRMED, DEM_UPDATE_RECORD_NO}
};


const Dem_ExtendedDataClassType Dem_ExtendedDataClassConfig[1u] = 
{
    /* extendedDataRecordClassRef */
    {(Dem_ExtendedDataRecordClassType*)&Dem_ExtendedDataRecordClassConfig[0u]}
};

const Dem_FreezeFrameRecordClassType Dem_FreezeFrameRecordClassConfig[1u] = 
{
    /* recordNumber, recordTrigger,            recordUpdate */
    {1u,             DEM_TRIGGER_ON_CONFIRMED, DEM_UPDATE_RECORD_NO}
};


const Dem_FreezeFrameRecNumClassType Dem_FreezeFrameRecNumClassConfig[1u] = 
{
    /* freezeFrameRecordClassRef */
    {(Dem_FreezeFrameRecordClassType*)&Dem_FreezeFrameRecordClassConfig[0u]}
};

const Dem_DidClassType Dem_DidClassConfig[1u] = 
{
    /* identifier */
    {0x0001u}
};

const Dem_FreezeFrameClassType Dem_FreezeFrameClassConfig[1u] = 
{
    /* didClassRef */
    {(Dem_DidClassType*)&Dem_DidClassConfig[0u]}
};

const Dem_DTCAttributesType Dem_DTCAttributesConfig[1u] = 
{
    /* extendedDataClassRef,                                        maxNumberFreezeFrameRecords, freezeFrameRecNumClassRef,                                                freezeFrameClassRef,                                           agingCycleCounterThreshold, agingCycleCounterThresholdForTFSLC, dtcPriority, dtcSignificance */
    {(Dem_ExtendedDataClassType*)&Dem_ExtendedDataClassConfig[0], 1u,                          (Dem_FreezeFrameRecNumClassType*)&Dem_FreezeFrameRecNumClassConfig[0], (Dem_FreezeFrameClassType*)&Dem_FreezeFrameClassConfig[0u], 1u,                         1u,                                 1u,          DEM_EVENT_SIGNIFICANCE_FAULT}
};

const Dem_DTCType Dem_DtcConfig[DemConf_DemEventId_Max] = 
{
    /* dtcValue, dtcAttributesRef, dtcSeverity,  nvStorageStrategy */
    {0x000001u,  }, /* DTC_0x000001 */
};

const Dem_OperationCycleType Dem_OperationCycleConfig[1u] = 
{
    {0x01u}
};

const Dem_DebounceTimeBasedClassType Dem_DebounceTimeBasedClassConfig[DemConf_DemEventId_Max] = 
{
    /* failedThreshold, passedThreshold, behavior,             fdcThresholdStorageValue */
    {127,               -128,            DEM_DEBOUNCE_FREEZE,  0x00u}
};

    
const Dem_DebounceCounterBasedClassType Dem_DebounceCounterBasedClassConfig[DemConf_DemEventId_Max] = 
{
    /* incrementStepSize, decrementStepSize, failedThreshold, passedThreshold, jumpUp, jumpDown, jumpDownValue, jumpUpValue, behavior,             storage, fdcThresholdStorageValue*/
    {5u,                  3u,                127,             -128,            SET,    SET,      1u,            1u,          DEM_DEBOUNCE_FREEZE,  SET,      0u  }
};


const Dem_EventParameterType Dem_EventParameterConfig[DemConf_DemEventId_Max] = 
{
    /* DemEventId,                    DemEventKind,       DemDTCRef,                                                      DemEventConfirmationThreshold, DemOperationCycleRef,                                    DemDebounceAlgorithmClass */
    {DemConf_DemEventId_DTC_0x000001, DEM_EVENT_KIND_SWC, (Dem_DTCType*)&Dem_DtcConfig[DemConf_DemEventId_DTC_0x000001], 127u,                          (Dem_OperationCycleType*)&Dem_OperationCycleConfig[0u], {{NULL_PTR}, {(Dem_DebounceCounterBasedClassType*)&Dem_DebounceCounterBasedClassConfig[0u]}}}, /* DTC_0x000001 */
    {DemConf_DemEventId_DTC_0x000001, DEM_EVENT_KIND_SWC, (Dem_DTCType*)&Dem_DtcConfig[DemConf_DemEventId_DTC_0x000001], 127u,                          (Dem_OperationCycleType*)&Dem_OperationCycleConfig[0u], {{NULL_PTR}, {(Dem_DebounceCounterBasedClassType*)&Dem_DebounceCounterBasedClassConfig[0u]}}}  /* DTC_0x000001 */
};


